<?php

class LoginForm extends Zend_Form{
	public function __construct($options = null)
	{
		parent::__construct($options);
		// set the form decorator path
		$this->addPrefixPath('Vmg_Form_Decorator', 'Vmg/Form/Decorator', 'decorator');

		$this->setName('login');
		$this->setAttrib('id', 'loginForm');
		$registry = Zend_Registry::getInstance();
		$translate = $registry->get('Zend_Translate');
		$username = new Zend_Form_Element_Text('username');
		$username->setLabel('Username')
		->setAttrib('id', 'usernameLoginForm')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim')
		->addValidator('NotEmpty')
		->setAttrib('size', 20)
		->setDecorators(array('Composite'));

		$password = new Zend_Form_Element_Password('password');
		$password->setLabel('Password')
		->setAttrib('id', 'passwordLoginForm')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim')
		->addValidator('NotEmpty')
		->setAttrib('size', 16)
		->setDecorators(array('Composite'))
		;

		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitLoginForm');
		$submit->setValue('Login');
		$submit->setLabel('');
		$submit->setDecorators(array('Composite'));
		$this->setTranslator($translate);
		$this->addElements(array( $username, $password, $submit));

	}
}